#include "Loginform.h"

LoginForm::LoginForm(QWidget *parent)
    : QDialog(parent)
{
	ui.setupUi(this);
	connect(ui.LoginButton, SIGNAL(clicked()), this, SLOT(LoginButtonClick()));
}

LoginForm::~LoginForm()
{

}

void LoginForm::LoginButtonClick()
{
	// vlepw ti typo epelekse o xristis

	// elegxos gia swsta stoixeia
	if (CheckCredentials((ui.UsernameEdit)->text(), (ui.PasswordEdit)->text(), tr("")))
	{
		this->hide();


		// emfanisi tis katallilis formas

		// emfanisi formas grammatea
		SecretaryCentralManagmentForm* form = new SecretaryCentralManagmentForm(this);
		form->exec();


		this->show();
	}

}

bool LoginForm::CheckCredentials(QString username, QString password, QString accountType)
{
	bool valid = true;

	// kalw to model gia epivevaiwsi stoixeiwn

	return valid;
}
